package b1.project.product.controller;

import b1.project.product.entity.ProductEntity;
import b1.project.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sun
 * @date 2025/7/21 00:39
 */
@Validated
@RequestMapping("/product")
@RestController
public class ProductController {
    @Autowired
    ProductService productService;

    /**
     * 查询商品
     */
    @GetMapping("/findById/{id}")
    public ProductEntity findProductById(@PathVariable("id") String id) {
        return productService.findById(id);
    }
}
